Skip to content

[backport camel-4.14.x] CAMEL-24341: camel-google-secret-manager - fix GCP vault refresh task defects - #25340

Merged
oscerd merged 1 commit into
apache:camel-4.14.xfrom
oscerd:backport/CAMEL-24341-4.14.x
Aug 5, 2026
Merged

[backport camel-4.14.x] CAMEL-24341: camel-google-secret-manager - fix GCP vault refresh task defects#25340
oscerd merged 1 commit into
apache:camel-4.14.xfrom
oscerd:backport/CAMEL-24341-4.14.x

Conversation

@oscerd

@oscerd oscerd commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Backport of #25326 (CAMEL-24341).

The GCP vault refresh task (PubsubReloadTriggerTask) read the AWS vault configuration (getVaultConfiguration().aws().getSecrets()) instead of the GCP one, so a GCP secret-refresh subscription watched the wrong secret list. This branch has the same defect. Cherry-picked cleanly (pom auto-merged); PubsubReloadTriggerTaskTest — 4 tests pass.

Claude Code on behalf of Andrea Cosentino (@oscerd).

🤖 Generated with Claude Code

… defects (apache#25326)

* CAMEL-24341: camel-google-secret-manager - fix GCP vault refresh task defects

The GCP secret refresh task read the AWS vault configuration, so
camel.vault.gcp.secrets was never honoured. It also kept triggerReloading
as receiver state, so every message following a matching secret event
triggered another CamelContext reload, restarted the subscriber on every
period (a Google ApiService can only be started while it is NEW), and
dereferenced the secretId/eventType attributes without a null check, so a
message published on the subscription by anything else failed and was
redelivered forever.

Also aligns the javadoc of the task and of the properties function with GCP
and reuses a single ObjectMapper for secret sub-key lookups.

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>

* CAMEL-24341: address review - AssertJ and package-private test conventions

Per davsclaus's non-blocking note, PubsubReloadTriggerTaskTest now uses
package-private class/@test visibility and AssertJ assertions (assertThat,
assertThatThrownBy, assertThatCode(...).doesNotThrowAnyException()). The
interface-override methods (onReload/ack/nack) stay public since they override
public API. Adds a test-scoped assertj-core dependency, not previously on the
module's test classpath.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>

---------

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@oscerd oscerd added bug Something isn't working backport indicate that a Pull request is a backport from a fix from the main branch labels Aug 5, 2026
@oscerd oscerd self-assigned this Aug 5, 2026
@oscerd oscerd added this to the 4.14.9 milestone Aug 5, 2026
@oscerd
oscerd requested a review from davsclaus August 5, 2026 06:51

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean cherry-pick backport to camel-4.14.x of the same fix as PR #25339 (originally PR #25326 on main). Code-level diff is identical to the main branch fix; the only adaptation is the expected pom.xml dependency name (camel-test-junit5 on 4.14.x vs camel-test-junit6 on main).

The fix correctly addresses the same four defects as described in the 4.18.x backport review — wrong vault config source, sticky reload flag, illegal ApiService restart, and null-safety for message attributes. All fixes are well-tested and verified present on the 4.14.x base branch. No API surface changes, safe for the maintenance branch. CI green.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of @gnodet

@oscerd
oscerd merged commit 765e51a into apache:camel-4.14.x Aug 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport indicate that a Pull request is a backport from a fix from the main branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants